Package-level declarations

Types

Link copied to clipboard
class KmmResult<T>

Swift-Friendly variant of stdlib's Result. For easy use under iOS, we need a class like Result that is not a value class (which is unsupported in Kotlin/Native)

Functions

Link copied to clipboard
inline fun <T> catching(block: () -> T): KmmResult<T>

Non-fatal-only-catching version of stdlib's runCatching, directly returning a KmmResult -- Re-throws any fatal exceptions, such as OutOfMemoryError. Relies on Arrow's nonFatalOrThrow internally.

Link copied to clipboard
inline fun <T, R> T.catching(block: T.() -> R): KmmResult<R>

Non-fatal-only-catching version of stdlib's runCatching (calling the specified function block with this value as its receiver), directly returning a KmmResult -- Re-throws any fatal exceptions, such as OutOfMemoryError. Relies on Arrow's nonFatalOrThrow internally.